diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-11-20 22:50:04 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-11-20 22:50:04 +0000 |
| commit | 7b19c504459e2368ceb42540691abf664db935c6 (patch) | |
| tree | 73819aabaea50411e3f31ae6eb448b2c0bd77667 /snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected | |
| parent | 86f7fa2960fe0eaa49f0cebdedd8cc04f31ebd76 (diff) | |
Support capture of vars in effect handler methods
Diffstat (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected')
1 files changed, 63 insertions, 0 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..2ef7f02e --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,63 @@ +Compilation unit elements: + +( + function + "shed__function__f__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (val "local__a" data-ptr) (val "local__b" data-ptr)) + return-type=int + body=( + ( + memory-load + (local "local__a") + pointer=(local "closurePointer__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 0) + ) + ( + memory-load + (local "local__b") + pointer=(local "closurePointer__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 1) + ) + (return (local "local__a")) + ) +) + +Locals: + * (val "local__a" data-ptr) + * (val "local__b" data-ptr) + * (val "closure__f__0" int) + * (val "closurePointer__f__0" data-ptr) + +Instructions: + +( + (alloc-heap (local "closurePointer__f__0") (struct (function-ptr (struct (data-ptr data-ptr))))) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(0) + value=(function-ptr "shed__function__f__0") + ) + (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0")) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 0) + value=(local "local__a") + ) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 1) + value=(local "local__b") + ) +) + +Temporary stack: + * closure__f__0 |
